#include "stdafx.h"

#include "point.h"
#include "config.h"

namespace DeepZoomImage 
{
	bool Point::FromStr (const char *s, Point *p)
	{
		GArray *values = double_garray_from_str (s, 2);

		if (!values)
			return false;

		*p = Point (g_array_index (values, double, 0), g_array_index (values, double, 1));

		g_array_free (values, true);

		return true;
	}

	Point Point::Transform (cairo_matrix_t *matrix)
	{
		double nx = x;
		double ny = y;

		cairo_matrix_transform_point (matrix, &nx, &ny);

		return Point (nx, ny);
	}
};
